from flask import Flask, jsonify
import random

app = Flask(__name__)

@app.route('/api/data/wx36abdaab13191c15')
def get_data():
    # 模拟数据（实际替换为真实传感器读取）
    return jsonify({
        "temp": round(20 + random.random() * 10, 1),  # 20-30°C
        "humi": round(40 + random.random() * 30, 1)   # 40-70%
    })

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)